import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/message',
    name: 'message',
    component: () => import('../testing/Message.vue'),
  },
  {
    path: '/modify',
    name: 'modify',
    component: () => import('../testing/Modify.vue'),
  },
  {
    path: '/set',
    name: 'set',
    component: () => import('../testing/Set.vue'),
  },
  // 详情页路由
  {
    path: '/dolphin',
    name: 'dolphin',
    component: () => import('../views/Dolphin.vue'),
  },
  // 注册理由
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/Register.vue'),
  },
  // 登录路由
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue'),
  },
  // 游客服务路由
  {
    path: '/vistor',
    name: 'vistor',
    component: () => import('../views/Vistor.vue'),
  },
  // 我的订单路由
  {
    path: '/order',
    name: 'order',
    component: () => import('../views/Order.vue'),
  },
  // 购买门票路由
  {
    path: '/buyticket',
    name: 'buyticket',
    component: () => import('../views/BuyTicket.vue'),
  },
  
  // 首页日历路由
  {
    path: '/myrestaurant',
    name: 'myrestaurant',
    component: () => import('../views/Myrestaurant.vue'),
  },
  
  // 商城 套餐路由
  {
    path: '/taocan',
    name: 'taocan',
    component: () => import('../views/TaoCan.vue'),
  },
  {
    path: '/hotel',
    name: 'hotel',
    component: () => import('../views/Hotel.vue'),
  },
  
  {
    path: '/shopping',
    name: 'shopping',
    component: () => import('../views/Shopping.vue'),
  },
  
  {
    path: '/',
    redirect:'/home/index'
  },
  {
    path: "/home",
    name: "home",
    component: HomeView,
    children: [
      {
        path: "index",
        component: () => import("../views/Index.vue"),
      },
      {
        path: "shopping",
        component: () => import("../views/Shopping.vue"),
      },
      {
        path: "me",
        component: () => import("../views/Me.vue"),
      },
    ],
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
